﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<UncleBobWebService.Models.MultipleChoiceQuestion>" %>

<!DOCTYPE html>

<html>
  <head id="Head1" runat="server">
    <title>Application</title>
    <link href="/Theme/UncleBobTheme.css" rel="Stylesheet" />
  </head>

<body>
    <h2>Question</h2>
    <div class="body">
        <form id=form1 runat=server action="/ApplicantApply/FormAction">
        <div class="box">
            <div class="left-justify">
                <div><%= Html.DisplayFor(model => Model.Question) %></div>
                <br />

                <!-- generate the number of radio buttons dynamically -->
                <% for (int i = 0; i < Model.PossibleAnswers.Count; ++i) { %>
                <label>
                    <%= Html.RadioButton("answer", i)%> <%=Model.PossibleAnswers[i].TheAnswer%><br />
                </label>
                <% } %>
            </div>
        </div>

        <!-- should not have a "previous" button at beginning of application,
             figure out a way to generate these dynamically -->
        <%if (Model.RuntimeCount == 0)
          {%>
        <input class="button" type="submit" name="next" value="Next" />
        <%}%>
        <%else
          {%>
        <input class="button" type="submit" name="previous" value="Previous" />
        <input class="button" type="submit" name="next" value="Next" />
        <%} %>
        </form>
    </div>
</body>

</html>